package cn.iocoder.an.module.business.dal.mysql.equipmentcheckrecorddetail;

import java.util.*;

import cn.iocoder.an.framework.common.pojo.PageResult;
import cn.iocoder.an.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.an.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.an.module.business.dal.dataobject.equipmentcheckrecorddetail.EquipmentCheckRecordDetailDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.an.module.business.controller.admin.equipmentcheckrecorddetail.vo.*;

/**
 * 点检记录明细 Mapper
 *
 * @author zzy
 */
@Mapper
public interface EquipmentCheckRecordDetailMapper extends BaseMapperX<EquipmentCheckRecordDetailDO> {

    default PageResult<EquipmentCheckRecordDetailDO> selectPage(EquipmentCheckRecordDetailPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<EquipmentCheckRecordDetailDO>()
                .eqIfPresent(EquipmentCheckRecordDetailDO::getRecordId, reqVO.getRecordId())
                .eqIfPresent(EquipmentCheckRecordDetailDO::getCheckItemId, reqVO.getCheckItemId())
                .likeIfPresent(EquipmentCheckRecordDetailDO::getFileName, reqVO.getFileName())
                .eqIfPresent(EquipmentCheckRecordDetailDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(EquipmentCheckRecordDetailDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(EquipmentCheckRecordDetailDO::getId));
    }

}